package com.hqyj.hrms.modules.salary.controller;



import com.hqyj.hrms.modules.salary.entity.Salary;
import com.hqyj.hrms.modules.salary.service.SalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-10-07
 */
@RestController
@RequestMapping("/salary")
public class SalaryController {
    @Autowired
    private SalaryService salaryService;
    @GetMapping("/add")
    public HashMap<String, Object> add(Salary salary) {
        return salaryService.add(salary);
    }
    @GetMapping("/update")
    public HashMap<String, Object> update(Salary salary) {

        return  salaryService.update(salary);
    }
    @GetMapping("/del")
    public HashMap<String, Object> del(Integer salId) {

        return salaryService.del(salId);
    }

    @GetMapping("/list")
    public HashMap<String, Object> list(Salary salary) {

        return salaryService.list(salary);
    }

    @GetMapping("/monthList")
    public HashMap<String, Object> selectByMonth2(String month) {
        return salaryService.selectByMonth2(month);
    }

    @GetMapping("/test")
    public List<Salary> totalNum(Salary salary) {
        return salaryService.totalNum(salary);
    }

    @GetMapping("/chart")
    public List<Map> chart() {
       return  salaryService.chart();
    }

    @GetMapping("/chart2")
    public List<Map> chart2() {
        return  salaryService.chart2();
    }
    }


